<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img" :src="bannerImg" alt="">
      <div class="banner-info">
        <div class="banner-title">
          {{this.sightName}}
        </div>
        <div class="banner-number">
          <span class="iconfont icontupianimgyulan banner-icon">&#xe635;</span>
          {{this.bannerImgs.length}}</div>
          </div>
  </div>
  <FadeAnimation>
  <common-gallary @close = "handleGallaryClose" v-show="showGallary" :imgs = "bannerImgs"></common-gallary>
  </FadeAnimation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/Fade.vue'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String,
    bannerImg: String,
    bannerImgs: Array
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  data () {
    return {
      showGallary: false,
      imgs: [
        'https://imgs.qunarzz.com/vs_ceph_vs_tts/16eeec21-d967-475f-b6b8-3d13cda49d93.jpg_r_390x260x95_074afa5c.jpg',
        'http://img1.qunarzz.com/sight/p0/1505/d2/d274c92de14c93da.water.jpg_710x360_a1f86ab7.jpg'
      ]
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
 .banner
   position relative
   overflow hidden
   height 0
   padding-bottom 55%
   .banner-img
     width 100%
   .banner-info
     display flex
     position absolute
     left 0
     right 0
     bottom 0
     background-image linear-gradient(top ,rgba( 0,0,0,0),rgba(0,0,0,0.8))
     line-height .6rem
     color #ffffff
     .banner-title
       flex 1
       font-size .32rem
       padding 0 .2rem
     .banner-number
       height .32rem
       line-height .32rem
       margin-top 2px
       padding .1rem .2rem
      .banner-icon
       margin-right 2px
</style>
